package com.itboye.mengwu.app.ui.aiwujia;

import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;

import com.itboye.core.object.BaseFragment;
import com.itboye.mengwu.R;
import com.itboye.mengwu.widget.PagerSlidingTabStrip;

public class ActivityContentCollection extends BaseFragment {
	String titles[] = { "商品收藏", "内容收藏" };
	ViewPager pager;
	PagerSlidingTabStrip tabs;

	ArrayList<Fragment> list;

	@Override
	public int initView() {
		// TODO Auto-generated method stub
		return R.layout.acyivity_collection;
	}

	class MyAdapter extends FragmentStatePagerAdapter {
		String[] _titles;

		public MyAdapter(FragmentManager fm, String[] _titles) {
			super(fm);
			this._titles = _titles;
		}

		@Override
		public CharSequence getPageTitle(int position) {
			return _titles[position];
		}

		@Override
		public Fragment getItem(int arg0) {
			Log.d("hu", "arg0" + arg0);
			switch (arg0) {
			case 0: {
				// return new CastOfLoveItemFragment();
				return new FragementMomZeng();
			}
			case 1: {
				return new FragementYuErCollection();
			}

			default:
				break;
			}
			return null;

		}

		@Override
		public int getCount() {
			return _titles.length;
		}

	}

	@Override
	public void onMyActivityCreated() {
		// TODO Auto-generated method stub
		list = new ArrayList<Fragment>();
		list.add(new FragementMomZeng());
		list.add(new FragementYuErCollection());
		pager.setAdapter(new MyAdapter(getChildFragmentManager(), titles));
		tabs.setViewPager(pager);
	}

}
